package com.derbysoft.dswitch;

import com.derbysoft.dswitch.dto.hotel.reservation.CancelInfoDTO;
import com.derbysoft.dswitch.dto.hotel.reservation.HotelCancelRS;
import com.derbysoft.dswitch.remote.hotel.dto.*;
import org.springframework.stereotype.Service;

/**
 * Created by: jason
 * Date: 2012-05-15
 */
@Service("hotelProviderWebService")
public class HotelRemoteServiceProxy extends BaseHotelRemoteService {

    @Override
    public HotelAvailResponse getNoCachedAvailability(HotelAvailRequest request) {
        throw new UnsupportedOperationException();
    }

    @Override
    public HotelReservationResponse makeReservation(HotelReservationRequest request) {
        throw new UnsupportedOperationException();
    }

    @Override
    public HotelCancelResponse cancelReservation(HotelCancelRequest request) {
        HotelCancelResponse response = new HotelCancelResponse();
        response.setTaskId(request.getHeader().getTaskId());
        HotelCancelRS hotelCancelRS = new HotelCancelRS();
        CancelInfoDTO cancelInfo = new CancelInfoDTO();
        cancelInfo.setHotelCancellationNO("Cancel-" + String.valueOf(Math.random()).substring(3, 10));
        hotelCancelRS.setCancelInfo(cancelInfo);
        response.setHotelCancelRS(hotelCancelRS);
        return response;
    }
}
